package com.lee.springCloud.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author Lee
 * @createDate 2021/12/22 17:00
 */
@Controller
public class OrderController {
    /** 负载均衡访问地址 **/
    public static final String PAYMENT_URL = "http://cloud-provider-payment";

    /** http调用模板 **/
    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/payment/zk")
    @ResponseBody
    public String getPayment(){
        String result = restTemplate.getForObject(PAYMENT_URL+"/payment/zk",String.class);
        return result;
    }
}
